home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 8
/
QRZ Ham Radio Callsign Database - Volume 8.iso
/
pc
/
files
/
dsp
/
fteyaltr.z
/
fteyaltr
/
fftsub86.mac
< prev
next >
Wrap
Text File
|
1991-08-31
|
4KB
|
239 lines
;*------------------------ fftsub86.mac ------------------------------- */
;* */
;* Author: Eyal Lebedinsky */
;* Date: May 1990 */
;* Version: 9 June 1991 */
;* */
;* used by output of fftg86.c and generates intel 80x86.asm */
;* This one is in masm syntax. */
;* */
;* This program is released into the public domain. */
;* */
;*--------------------------------------------------------------------- */
;
fft1 MACRO i
sar _x+i,1
endm
fft2 MACRO i0,i1
; t1 = x[i0] >> 1;
mov ax,_x+i0
sar ax,1
; x[i0] = t1 + (x[i1] >> 1);
mov bx,_x+i1
sar bx,1
mov cx,ax
add cx,bx
mov _x+i0,cx
; x[i1] = t1 - (x[i1] >> 1);
sub ax,bx
mov _x+i1,ax
endm
fft3 MACRO i1,i3,i4
; fft3 i1,i3,i4
; 1 2 3
; x[i4] = ((x[i4] >> 1) - (x[i3] >> 1)) >> 1;
mov ax,_x+i4
sar ax,1
mov bx,_x+i3
sar bx,1
mov cx,ax
sub cx,bx
sar cx,1
mov _x+i4,cx
; t1 = ((x[i4] >> 1) + (x[i3] >> 1)) >> 1; ax=
add ax,bx
sar ax,1
; x[i3] = (x[i1] >> 1) - t1;
mov bx,_x+i1
sar bx,1
mov cx,bx
sub cx,ax
mov _x+i3,cx
; x[i1] = (x[i1] >> 1) + t1;
add ax,bx
mov _x+i1,ax
endm
fft4 MACRO i1,i2,i3,i4,cc1
; fft4 i1,i2,i3,i4,cc1 t1 t2
; 1 2 3 4 5 di si
; t3 = mul1 (x[i3], cc1);
mov ax,_x+i3
mov cx,cc1
imul cx
mov di,dx
mov si,dx
; t4 = mul1 (x[i4], cc1);
mov ax,_x+i4
imul cx
; t1 = t3 + t4;
add di,dx
; t2 = t3 - t4;
sub si,dx
; x[i4] = (x[i2] >> 1) - t1;
mov ax,_x+i2
sar ax,1
mov bx,ax
sub bx,di
mov _x+i4,bx
; x[i3] = -(x[i2] >> 1) - t1;
neg ax
sub ax,di
mov _x+i3,ax
; x[i2] = (x[i1] >> 2) - t2;
mov ax,_x+i1
sar ax,1
sar ax,1
mov bx,ax
sub bx,si
mov _x+i2,bx
; x[i1] = (x[i1] >> 2) + t2;
add ax,si
mov _x+i1,ax
endm
fft5a MACRO i3,i7,sm1,sp1,cc1,ind
; fft5a i3,i7,sm1,sp1,cc1,ind t1 t2 t3 t4
; 1 2 3 4 5 6 bx cx si di
;
; t5 = x[i7]; bp=
mov bp,_x+i7
; t1 = mul1 (t5, sm1); bx=
mov ax,sm1
imul bp
mov bx,dx
; t6 = x[i3]; ax=
mov ax,_x+i3
if ind
; t6 = x[i3] >> 1; ax=
sar ax,1
endif
; t5 += t6; bp=
add bp,ax
; t2 = mul1 (t6, sp1); cx=
mov dx,sp1
imul dx
mov cx,dx
; t5 = mul1 (t5, cc1); dx=
mov ax,cc1
imul bp
; t1 += t5; bx=
add bx,dx
; t2 += t5; cx=
add cx,dx
endm
fft5b MACRO i4,i8,sm3,sp3,cc3,ind
; fft5b i4,i8,sm3,sp3,cc3,ind t1 t2 t3 t4
; 1 2 3 4 5 6 bx cx si di
;
; t5 = x[i8]; bp=
mov bp,_x+i8
; t3 = mul1 (t5, sm3); si=
mov ax,sm3
imul bp
mov si,dx
; t6 = x[i4]; ax=
mov ax,_x+i4
if ind
; t6 = x[i4] >> 1; ax=
sar ax,1
endif
; t5 += t6; bp=
add bp,ax
; t4 = mul1 (t6, sp3); di=
mov dx,sp3
imul dx
mov di,dx
; t5 = mul1 (t5, cc3); dx=
mov ax,cc3
imul bp
; t3 += t5; si=
add si,dx
; t4 += t5; di=
add di,dx
;
endm
fft5c MACRO i1,i2,i3,i4,i5,i6,i7,i8
; fft5c i1,i2,i3,i4,i5,i6,i7,i8 t1 t2 t3 t4
; 1 2 3 4 5 6 7 8 bx cx si di
; t5 = t3 - t1; ax=
mov ax,si
sub ax,bx
; t6 = x[i2] >> 1; dx=
mov dx,_x+i2
sar dx,1
; x[i7] = -t6 + t5;
mov bp,ax
sub bp,dx
mov _x+i7,bp
; x[i4] = t6 + t5;
add ax,dx
mov _x+i4,ax
;
; t5 = t2 + t4; ax=
mov ax,cx
add ax,di
; t6 = x[i6] >> 1; dx=
mov dx,_x+i6
sar dx,1
; x[i3] = -t6 + t5;
mov bp,ax
sub bp,dx
mov _x+i3,bp
; x[i8] = t6 + t5;
add ax,dx
mov _x+i8,ax
;
; t1 t2 t3 t4
; bx cx si di
; t5 = t1 + t3; bx=
add bx,si
; t6 = x[i1] >> 1; dx=
mov dx,_x+i1
sar dx,1
; x[i6] = t6 - t5;
mov bp,dx
sub bp,bx
mov _x+i6,bp
; x[i1] = t6 + t5;
add bx,dx
mov _x+i1,bx
;
; t5 = t2 - t4; cx=
sub cx,di
; t6 = x[i5] >> 1; dx=
mov dx,_x+i5
sar dx,1
; x[i5] = t6 - t5;
mov bp,dx
sub bp,cx
mov _x+i5,bp
; x[i2] = t6 + t5;
add cx,dx
mov _x+i2,cx
endm
fft7 MACRO i1,i2
mov ax,_x+i2
imul ax
mov _qf+i1,dx
endm
fft8 MACRO i1,i2,i3
mov ax,_x+i2
imul ax
mov bx,ax
mov cx,dx
mov ax,_x+i3
imul ax
add ax,bx
adc dx,cx
mov _qf+i1,dx
endm
_TEXT SEGMENT WORD PUBLIC 'CODE'
_TEXT ENDS
_DATA SEGMENT WORD PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT WORD PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT WORD PUBLIC 'BSS'
_BSS ENDS
DGROUP GROUP CONST, _BSS, _DATA
ASSUME CS: _TEXT, DS: DGROUP, SS: DGROUP